LOCAL_PATH		:= $(call my-dir)

#Main source path
MY_CODE_PATH	:=	$(LOCAL_PATH)/../../AppSource/Source

#Framework
MY_FW_INCL_PATH	:=	$(LOCAL_PATH)/../../Include/Framework

#=======================
#Prebuild Framework Library
#=======================
include $(CLEAR_VARS)
LOCAL_MODULE	:=	fw-prebuild
LOCAL_SRC_FILES	:=	$(LOCAL_PATH)/../lib/$(TARGET_ARCH_ABI)/libFramework.so
include $(PREBUILT_SHARED_LIBRARY)

#=======================
#Build Android Native Code
#=======================
include $(CLEAR_VARS)
LOCAL_MODULE    := 	gl2_jni_view_GL2JniLib
LOCAL_CFLAGS    := 	-mandroid \
                  	-ffunction-sections \
                    -funwind-tables \
                    -fstack-protector \
                    -fpic \
                    -Wno-psabi \
                    -Wno-write-strings \
                    -fsigned-char \
                    -fomit-frame-pointer \
                    -fno-strict-aliasing \
                    -finline-limit=300 \
                    -ffast-math \
                    -pipe \
                    -g \
                    -w -O3 \
                    -fno-rtti \
                    -fexceptions
LOCAL_CPPFLAGS 	+= 	-std=c++11
LOCAL_SRC_FILES := 	GL2JniLib.cpp	\
					LibReference.cpp \
					$(MY_CODE_PATH)/Game.cpp \
					$(MY_CODE_PATH)/AppCore/ObjectMesh.cpp \
					$(MY_CODE_PATH)/AppCore/ObjectTexture.cpp \
					$(MY_CODE_PATH)/AppCore/ObjectShader.cpp \
					$(MY_CODE_PATH)/State/Logo.cpp \
					$(MY_CODE_PATH)/Entity/Image2D.cpp
LOCAL_LDLIBS    := 	-llog -lGLESv2
LOCAL_SHARED_LIBRARIES	:= 	fw-prebuild
LOCAL_C_INCLUDES		+= 	$(MY_FW_INCL_PATH)
include $(BUILD_SHARED_LIBRARY)